package com.lhnstart.learn.bases.final_;

/**
 * final 详解
 *
 * @author lhn
 * @date 2023/07/13 11:03
 * @since 1.0.0
 **/
public class Final01 {

    public static void main(String[] args) {
        A a = new B("l");
        a.test();

    }

}

class A{

    public final String name = "李";
    public final String name1;
    public final String name2;

    {
        name1 = "李";
    }

    public A(String name2) {
        this.name2 = name2;
    }

    public final void test() {
        System.out.println("测试");
    }
}

class B extends A {

    public B(String name2) {
        super(name2);
    }
}